import { request } from '@/service/request';

/** 获取用户游戏成就列表 */
export function fetchGetUserAchievementList (params?: Api.Games.UserAchievementSearchParams) {
    return request<Api.Games.UserAchievementList>({
        url: '/games/userAchievement/list',
        method: 'get',
        params
    });
}

/** 新增用户游戏成就 */
export function fetchCreateUserAchievement (data: Api.Games.UserAchievementOperateParams) {
    return request<boolean>({
        url: '/games/userAchievement',
        method: 'post',
        data
    });
}

/** 修改用户游戏成就 */
export function fetchUpdateUserAchievement (data: Api.Games.UserAchievementOperateParams) {
    return request<boolean>({
        url: '/games/userAchievement',
        method: 'put',
        data
    });
}

/** 批量删除用户游戏成就 */
export function fetchBatchDeleteUserAchievement (achievementIds: CommonType.IdType[]) {
    return request<boolean>({
        url: `/games/userAchievement/${achievementIds.join(',')}`,
        method: 'delete'
    });
}
